package com.study.design.pattern.pattern.behavioral.visitor;

import java.util.ArrayList;
import java.util.List;

/**
 * @Author: gongsl
 * @Date: 2025-03-26 22:36
 * @description: ObjectStructure(对象结构)-公司
 */
public class Company {
    private List<Employee> employees = new ArrayList<>();

    public void addEmployee(Employee employee) {
        employees.add(employee);
    }

    public void accept(EmployeeVisitor visitor) {
        for (Employee e : employees) {
            e.accept(visitor);
        }
    }
}
